home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #010 (199x)(Scope PD)(US)[WB].zip / Scope Disk #010 (199x)(Scope PD)(US)[WB].adf / Ixecute / ixecute.doc < prev    next >
Text File  |  1988-05-18  |  4KB  |  89 lines

  1. Well, here it is: my first C program.
  2.  
  3. What I wanted to do was put together a "killer demo" to impress my
  4. friends with my new Amiga's great graphics and sound. Not having the
  5. slightest idea how to do that, I thought I'd put a couple of canned
  6. things together. On my system, the "execute" file looked like this:
  7.  
  8. cd dh0:paint.stuff/animation
  9. run showanim -c +2 TELLSTAR-ONE
  10. cd :tools/sounds/thriller
  11. run led
  12. wait 14
  13. run play thriller
  14.  
  15. Now on my system at least, that would fire up a nifty anim I'd downloaded
  16. from CServe, plus a PD Sonix-player and a great rendition of "thriller"
  17. that a local BBS provided. With the "wait 14" in there, the two would
  18. come up simultaneously and blow everybody's socks off.
  19.  
  20. Trouble was, I had to launch the damn thing from CLI. All these neat
  21. icons, and to make the machine do anything serious I had to type magic
  22. incantations into a text window. Some demo.
  23.  
  24. Now, there may be a way to make a script like that execute from an
  25. icon, but I couldn't find out what it is. The few things I downloaded
  26. that sounded right turned out to have serious limitations: I had to
  27. type the lines into an icon INFO window (one of the more sophisticated
  28. text editors, don't you know), or "cd" wouldn't work, or.....
  29.  
  30. Which is how Ixecute came to be.
  31.  
  32. Ixecute can be named the default tool for any "project" icon. When the
  33. icon is clicked, the text file associated with it gets executed. Period.
  34. No games. My killer demo script works! Ixecute will even "run Pyro"
  35. without leaving a window hanging around!
  36.  
  37. Using Ixecute is simple. Use your favorite text editor to create a CLI
  38. script. Test it by executing it. When it works, take a handy "project"
  39. icon and give it the same name, with a .info extension. Open the INFO
  40. window and make the default tool Ixecute. (Depending on where you PUT
  41. Ixecute, you may have to make it "SYS:c/Ixecute" or something like
  42. that, but you get the idea). Double-click and away you go!
  43.  
  44. Expert mode:
  45.  
  46. For reasons unclear, new CLI's wake up with their current directory
  47. set to df0:, even when SYS: is a hard drive or dfn:. To make things
  48. easy for script writers, Ixecute allows for this: it does not pass the
  49. actual script file to the CLI it creates; it really passes a file called
  50. ixec.temp that it creates in the SYS:t directory (and deletes on its way
  51. out, so you'll never see it). The file ixec.temp contains the
  52. line "cd SYS:", then your script, and then the line "endcli". If you
  53. promise to be good, Ixecute will bypass the temp file and directly
  54. execute your script file. If you forget to "cd" to your destination,
  55. or fail to "endcli", don't blame Ixecute for what happens. You "promise
  56. to be good" by typing the word "expert" into the Tool Types field in the
  57. icon's INFO window.
  58.  
  59. I want you to know that adding that feature cost me several hours of
  60. sleep. If I'd just said in the docs: make sure you start with a "cd"
  61. and end with an "endcli", I wouldn't have needed it. If I'd just made
  62. everybody use the temp file, I wouldn't have needed it. But no -- my
  63. first C program was on a roll and I just HAD to figure out how to read
  64. that damn Tool Types field from inside a program three directories away.
  65. And having figured that out, I'm LEAVING THE FEATURE IN, even though
  66. bypassing the temp file only saves about 1.5 seconds.
  67.  
  68. The inevitable Legal Stuff:
  69.  
  70. Copyright 1988, Benson the Dog. Placed into the public domain by the
  71. author, who assumes no liability for its use or abuse. No warranties!
  72. If you use this program and you crash your system and lose six months of
  73. accounts receivable records, tough. You were warned: unattended CLI
  74. scripts can wreak havoc (you mean I typed "delete dh0:#?" ????).
  75.  
  76. To those paranoid about viruses:
  77.  
  78. I put the source code in the arc file. It was written for Lattice 4.0,
  79. but you Manx hackers can probably make it run. The best protection
  80. against viri is to only run things you compiled yourself from source
  81. you read youself. (Now watch some twit put a virus in the next rev of
  82. the compiler.)
  83.  
  84.  
  85. Bob Hahn
  86. April 26, 1988
  87. Cserve 70535,542
  88. Source TCU504
  89.